﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NetCore
{
    public class SiteConfig
    {
        /// <summary>
        /// 连接字符串
        /// </summary>
        public string ConnectionString { get; set; }

        /// <summary>
        /// 数据驱动
        /// </summary>
        public string ProviderType { get; set; }

        /// <summary>
        /// 是否启用EF
        /// </summary>
        public bool IsUseEF { get; set; }

        /// <summary>
        /// 应用程序头
        /// </summary>
        public string ApplicationName { get; set; }

        /// <summary>
        /// 是否启用Redis缓存
        /// </summary>
        public bool IsUseRedis { get; set; }

        /// <summary>
        /// 当前版本号
        /// </summary>
        public string Version { get; set; }

        /// <summary>
        /// 是否是Web应用
        /// </summary>
        public bool IsWeb { get; set; }

        /// <summary>
        /// 域
        /// </summary>
        public string Domain { get; set; }

        /// <summary>
        /// redis缓存配置
        /// </summary>
        public RedisConfig Redis { get; set; }

        /// <summary>
        /// 邮件配置
        /// </summary>
        public SMTPConfig SMTP { get; set; }

        /// <summary>
        /// cookis名
        /// </summary>
        public string CookieName { get; set; }

        /// <summary>
        /// md5加密
        /// </summary>
        public string MD5key { get; set; }

        /// <summary>
        /// 向量加密
        /// </summary>
        public string AESKey { get; set; }

        public string AESIV { get; set; }

        /// <summary>
        /// 日志接口
        /// </summary>
        public string DBLog { get; set; }

        private int _sessionTimeout = 20;
        public int SessionTimeout { get => _sessionTimeout; set => _sessionTimeout=value; }

        /// <summary>
        /// 用户缓存键值
        /// </summary>
        public string UserCacheKey { get; set; }

        /// <summary>
        /// 系统用户处理dll
        /// </summary>
        public string UserServiceInstance { get; set; }

        /// <summary>
        /// 文件存储路径
        /// </summary>
        public string BaseDirectory { get; set; }

        /// <summary>
        /// 静态文件浏览目录
        /// </summary>
        public string StaticBrower { get; set; }

        /// <summary>
        /// 初始化数据dll路径
        /// </summary>
        public string InitData { get; set; }

        /// <summary>
        /// 默认密码
        /// </summary>
        public string DefaultPassword { get; set; }

        public ConfigFile ConfigFile { get; set; }

        public string DefaultDirectory { get; set; }
    }

    /// <summary>
    /// redis缓存配置
    /// </summary>
    public class RedisConfig
    {

        public string Connection { get; set; }

        public string InstanceName { get; set; }

        public int DataBase { get; set; }

        public string Password { get; set; }

        public int KeepAlive { get; set; }

        public HashSet<string> CommandMap { get; set; }

    }
    /// <summary>
    /// 邮件配置
    /// </summary>
    public class SMTPConfig
    {

        public string Server { get; set; }

        public string  Account { get; set; }

        public string  Password { get; set; }

        public string SendAddress { get; set; }

        public int Port { get; set; }
    }

    /// <summary>
    /// 文件存放目录配置
    /// </summary>
    public class ConfigFile
    {
        public string publicPath { get; set; }

        public string tempPath { get; set; }

        public string rootPath { get; set; }

        public string configPath { get; set; }
    }
}
